﻿@{
    ViewBag.Title = "MostrarChanguito";
}

<p><a href="@Url.Action("Home")">Home</a></p>
<p><a href="@Url.Action("ABM")">ABM</a></p>
<p><a href="@Url.Action("Changuito")">Changuito</a></p>
<h2>Changuito</h2>
<table border= "1">
<thead>
    <tr>
        <th>Nombre</th>
        <th>Categoria</th>
        <th>Cantidad</th>
        <th>Precio</th>
        <th>Semi Total</th>
    </tr>
</thead>
<tbody>
    @{
        int co = 0;
        float total = 0;
        float semitot = 0;
        foreach (var i in Model)
        {
            semitot = i.precio * i.cantidad;
            <tr>
                <td>@i.nombre</td>
                <td>@i.categoria</td>
                <td>@i.cantidad</td>
                <td>@i.precio</td>
                <td>@semitot</td>
            </tr>
            co++;
            total = total + semitot;
        }
    }   
</tbody>
<tfoot>
    <tr>
        <th colspan="5">Total @total</th>
    </tr>
</tfoot>
</table>